<div id="tasksBlock">
    <div style="padding-bottom: 10px;"></div>

    <?php if (is_array($this->Info)) {
    ?>
        <div class="height12">&nbsp;</div>
        <table class="info-table">
            
        <?php echo $this->render('table_header.phtml') ?>

        <?php foreach ($this->Info as $item) {
        ?>
            <tr class="line1<?php echo (isset ($item['child'])) ? ' parent-tr' : ''?>">
            <?php
            foreach ($this->tableColumn as $tb_column) {
                $it = getItem($tb_column, $item);                
            ?>
                <td>
                <?php
                echo $it;
                ?>
            </td>
            <?php } ?>
        </tr>
        <?php if(isset ($item['child'])){
                    foreach ($item['child'] as $child){?>
                        <tr class="line1 child-tr">
                        <?php foreach ($this->tableColumn as $tb_column) {
                            echo '<td>'.getItem($tb_column, $child).'</td>';
                        }?>
                        </tr>
                    <?php }
                }} ?>
        <tr class="bottom-line">
            <td colspan="<?php echo count($this->tableColumn) ?>"></td>
        </tr>
    </table>
    <?php
    } else {
    ?>
        <div><?php echo $this->trans->_('rows_no_found'); ?></div>
    <?php }
    echo GetSnippets::addJsVar(); ?>
</div>

<?php

    function getItem($tb_column, $item) {
        if ($tb_column['title'] == 'active' || $tb_column['title'] == 'left_menu') {
            $it = '<div style="text-align: center">' . GetSnippets::getYN($item[$tb_column['title']]) . '</div>';
        } elseif ($tb_column['title'] == 'Change') {
            $it = '<div class="action_block" style="text-align: center">';
            $it .= '<a  onclick="getAction(\'edit-categories|' . $item['id'] . '||Create|400\')" class="p-left4" href="javascript: void(0)"><img src="/img/icon_edit.gif" alt="remove" title="remove" /></a>';
            $it .= '<a class="p-left4" href="javascript: void(0)" onclick="globalModule.deleteRow(\'' . $item['id'] . '\')"><img src="/img/icon_del.gif" alt="remove" title="remove" /></a>';
            $it .= '</div>';
        } elseif (gettype($item[$tb_column['title']]) != 'object') {
            if (is_numeric($item[$tb_column['title']])) {
                $it = '<div style="text-align: center">' . $item[$tb_column['title']] . '</div>';
            } else {
                $it = (string) $item[$tb_column['title']];
            }
        } else {
            $it = date_format($item[$tb_column['title']], 'Y-m-d H:i');
        }
        if (isset($tb_column['wrap'])) {
            switch ($tb_column['wrap']) {
                case 'div150':
                    $it = '<div style="width: 150px; max-height: 100px; overflow: auto;">' . $it . '</div>';
                    break;
                case 'div200':
                    $it = '<div style="width: 200px; max-height: 100px; overflow: auto;">' . $it . '</div>';
                    break;
            }
        }
        return $it;
    }
?>